PKG_NAME:=samba
PKG_VERSION:=4.10.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=GPL-3.0-only
define Package/samba4-libs
$(call Package/samba4/Default)
TITLE+= libs
- DEPENDS:= +zlib +libtirpc +libpopt +libcomerr +libtasn1 +libopenssl \
+ DEPENDS:= +zlib +libtirpc +libpopt +libcomerr +libtasn1 +libopenssl +libreadline \
+PACKAGE_libcap:libcap +PACKAGE_libpthread:libpthread +PACKAGE_libnettle:libnettle \
+PACKAGE_libgcrypt:libgcrypt +PACKAGE_libpam:libpam +PACKAGE_dbus:dbus +PACKAGE_libavahi-client:libavahi-client \
+SAMBA4_SERVER_VFS:attr \
+++ /dev/null
-Some modules such as dynamic library maybe cann't be imported while cross compile,
-we just check whether does the module exist.
-
-
---- a/buildtools/wafsamba/samba_bundled.py
-+++ b/buildtools/wafsamba/samba_bundled.py
-@@ -2,6 +2,7 @@
-
- import sys
- from waflib import Build, Options, Logs
-+import imp, os
- from waflib.Configure import conf
- from wafsamba import samba_utils
-
-@@ -249,17 +250,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li
- # versions
- minversion = minimum_library_version(conf, libname, minversion)
-
-- try:
-- m = __import__(modulename)
-- except ImportError:
-- found = False
-- else:
-+ # Find module in PYTHONPATH
-+ stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]])
-+ if stuff:
- try:
-- version = m.__version__
-- except AttributeError:
-+ m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2])
-+ except ImportError:
- found = False
-+
-+ if conf.env.CROSS_COMPILE:
-+ # Some modules such as dynamic library maybe cann't be imported
-+ # while cross compile, we just check whether the module exist
-+ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1]))
-+ found = True
- else:
-- found = tuplize_version(version) >= tuplize_version(minversion)
-+ try:
-+ version = m.__version__
-+ except AttributeError:
-+ found = False
-+ else:
-+ found = tuplize_version(version) >= tuplize_version(minversion)
-+ finally:
-+ if stuff[0]:
-+ stuff[0].close()
-+ else:
-+ found = False
-+
- if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
- Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
- sys.exit(1)
+++ /dev/null
---- a/libcli/smbreadline/wscript_configure
-+++ b/libcli/smbreadline/wscript_configure
-@@ -1,11 +1,13 @@
- #!/usr/bin/env python
-
-
--conf.CHECK_HEADERS('readline.h history.h readline/readline.h readline/history.h')
--for termlib in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']:
-- if conf.CHECK_FUNCS_IN('tgetent', termlib):
-- conf.env['READLINE_TERMLIB'] = termlib
-- break
-+#conf.CHECK_HEADERS('readline.h history.h readline/readline.h readline/history.h')
-+#for termlib in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']:
-+# if conf.CHECK_FUNCS_IN('tgetent', termlib):
-+# conf.env['READLINE_TERMLIB'] = termlib
-+# break
-+
-+conf.undefine('HAVE_READLINE_READLINE_H')
-
- #
- # Check if we need to work around readline/readline.h
--- /dev/null
+--- a/lib/crypto/wscript_configure
++++ b/lib/crypto/wscript_configure
+@@ -2,11 +2,11 @@
+ import Options
+ import Utils
+
+-if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
+- checklibc=True):
+- conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
+- checklibc=True)
+- conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
++# if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
++ # checklibc=True):
++conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
++ checklibc=True)
++conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
+ checklibc=True)
+ conf.CHECK_FUNCS_IN('CC_MD5_Init', '', headers='CommonCrypto/CommonDigest.h',
+ checklibc=True)
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -340,22 +340,13 @@ def configure(conf):
+
+ conf.CHECK_FUNCS('prctl dirname basename')
+
+- strlcpy_in_bsd = False
++ # Not checking for libbsd
++ conf.CHECK_FUNCS('strlcpy strlcat')
++ conf.CHECK_FUNCS('getpeereid')
++ conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
++ conf.CHECK_FUNCS('setproctitle_init')
+
+- # libbsd on some platforms provides strlcpy and strlcat
+- if not conf.CHECK_FUNCS('strlcpy strlcat'):
+- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+- checklibc=True):
+- strlcpy_in_bsd = True
+- if not conf.CHECK_FUNCS('getpeereid'):
+- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS('setproctitle_init'):
+- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+- if not conf.CHECK_FUNCS('closefrom'):
+- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++ conf.CHECK_FUNCS('closefrom')
+
+ conf.CHECK_CODE('''
+ struct ucred cred;
+@@ -698,9 +689,6 @@ def configure(conf):
+
+ # look for a method of finding the list of network interfaces
+ for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+- bsd_for_strlcpy = ''
+- if strlcpy_in_bsd:
+- bsd_for_strlcpy = ' bsd'
+ if conf.CHECK_CODE('''
+ #define %s 1
+ #define NO_CONFIG_H 1
+@@ -713,7 +701,7 @@ def configure(conf):
+ #include "test/getifaddrs.c"
+ ''' % method,
+ method,
+- lib='nsl socket' + bsd_for_strlcpy,
++ lib='nsl socket',
+ addmain=False,
+ execute=True):
+ break
+@@ -761,7 +749,6 @@ def build(bld):
+ break
+
+ extra_libs = ''
+- if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'
+
+ bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',
+ REPLACE_HOSTCC_SOURCE,
+++ /dev/null
---- a/lib/crypto/wscript_configure
-+++ b/lib/crypto/wscript_configure
-@@ -2,11 +2,11 @@
- import Options
- import Utils
-
--if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
-- checklibc=True):
-- conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
-- checklibc=True)
-- conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
-+# if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
-+ # checklibc=True):
-+conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
-+ checklibc=True)
-+conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
- checklibc=True)
- conf.CHECK_FUNCS_IN('CC_MD5_Init', '', headers='CommonCrypto/CommonDigest.h',
- checklibc=True)
---- a/lib/replace/wscript
-+++ b/lib/replace/wscript
-@@ -340,22 +340,13 @@ def configure(conf):
-
- conf.CHECK_FUNCS('prctl dirname basename')
-
-- strlcpy_in_bsd = False
-+ # Not checking for libbsd
-+ conf.CHECK_FUNCS('strlcpy strlcat')
-+ conf.CHECK_FUNCS('getpeereid')
-+ conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
-+ conf.CHECK_FUNCS('setproctitle_init')
-
-- # libbsd on some platforms provides strlcpy and strlcat
-- if not conf.CHECK_FUNCS('strlcpy strlcat'):
-- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
-- checklibc=True):
-- strlcpy_in_bsd = True
-- if not conf.CHECK_FUNCS('getpeereid'):
-- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
-- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
-- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
-- if not conf.CHECK_FUNCS('setproctitle_init'):
-- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
--
-- if not conf.CHECK_FUNCS('closefrom'):
-- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
-+ conf.CHECK_FUNCS('closefrom')
-
- conf.CHECK_CODE('''
- struct ucred cred;
-@@ -698,9 +689,6 @@ def configure(conf):
-
- # look for a method of finding the list of network interfaces
- for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
-- bsd_for_strlcpy = ''
-- if strlcpy_in_bsd:
-- bsd_for_strlcpy = ' bsd'
- if conf.CHECK_CODE('''
- #define %s 1
- #define NO_CONFIG_H 1
-@@ -713,7 +701,7 @@ def configure(conf):
- #include "test/getifaddrs.c"
- ''' % method,
- method,
-- lib='nsl socket' + bsd_for_strlcpy,
-+ lib='nsl socket',
- addmain=False,
- execute=True):
- break
-@@ -761,7 +749,6 @@ def build(bld):
- break
-
- extra_libs = ''
-- if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'
-
- bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',
- REPLACE_HOSTCC_SOURCE,
--- /dev/null
+--- a/source3/modules/vfs_fruit.c 2019-07-09
++++ b/source3/modules/vfs_fruit.c 2019-07-09
+@@ -6995,12 +6995,12 @@ static bool fruit_tmsize_do_dirent(vfs_h
+ return true;
+ }
+
+- if (bandsize > SIZE_MAX/nbands) {
+- DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
+- bandsize, nbands);
+- return false;
+- }
+- tm_size = bandsize * nbands;
++ // if (bandsize > SIZE_MAX/nbands) {
++ // DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
++ // bandsize, nbands);
++ // return false;
++ // }
++ tm_size = (off_t)bandsize * (off_t)nbands;
+
+ if (state->total_size + tm_size < state->total_size) {
+ DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
+++ /dev/null
---- a/source3/modules/vfs_fruit.c 2019-07-09
-+++ b/source3/modules/vfs_fruit.c 2019-07-09
-@@ -6995,12 +6995,12 @@ static bool fruit_tmsize_do_dirent(vfs_h
- return true;
- }
-
-- if (bandsize > SIZE_MAX/nbands) {
-- DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
-- bandsize, nbands);
-- return false;
-- }
-- tm_size = bandsize * nbands;
-+ // if (bandsize > SIZE_MAX/nbands) {
-+ // DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
-+ // bandsize, nbands);
-+ // return false;
-+ // }
-+ tm_size = (off_t)bandsize * (off_t)nbands;
-
- if (state->total_size + tm_size < state->total_size) {
- DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",